Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

{TEMPLATEURL} placeholder not working in the head.twig

  • StephenO
  • StephenO's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #198666 by StephenO
I am trying to use the {TEMPLATEURL} placeholder in the head.twig to ass inputmasking.js from the files folder.

But when I look at the final rendered survey source code the {TEMPLATEURL} placeholder is still in there, the engine didn't replace it with the actual url.

I can't find any documentation at all on 4.x.

I am using Version 4.1.18+200416
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #198685 by DenisChenu
Since twig is here : you can noit use Expression Manager in twig file directly

Did you use processString ?

Else : seems you have registerTemplateScript function to register a JS file

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
3 years 2 weeks ago #214763 by dsidd
Hi Denis,
I work on limesurvey 3.25.
I try to add js file (jquery.csv.js) with the registerTemplateScript function.
It seems that I need to turn on the 'use_custom_twig_extensions' in config file('use_custom_twig_extensions'=>true). When i try this option nothing appened. Where exactly do i have to add this line in config.file? Is the config file inside the 'limesurvey/application/config' folder?
Thank you for your help!
Arnaud
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 weeks ago #214776 by tpartner
In the "config" array of /application/config/config.php:

Code:
  'config'=>array(
    'debug'=>0,
    'debugsql'=>0, 
    // Update default LimeSurvey config here
    'use_custom_twig_extensions'=>true, // Enable the use of custom TWIG functions in question themes
  ),

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 weeks ago #214785 by DenisChenu
I thinki it's more easy to add it in you theme. No need use_custom_twig_extensions

1. Export template (and delete it)
2. unzip template
3. Add jquery.csv.js in scripts directory
4. Add <add>scripts/jquery.csv.js</add> in config.xml of your template at script part (sample for vanilla extended).
5. Zip your directory
6. Inport

With export/import and FTP access :
1. Add jquery.csv.js in scripts directory
2. Add <add>scripts/jquery.csv.js</add> in config.xml of your template at script part (sample for vanilla extended).
3. Reset options of theme


 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
3 years 2 weeks ago #214787 by dsidd
Thank you for your help Denis! This works for me.
The following user(s) said Thank You: DenisChenu
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose